package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmStaticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: liudehuan
 * @description
 * @date: 2023-04-22 17:42
 */
@RestController
@RequestMapping("/api/v1/statistics")
public class WmStaticController {

    @Autowired
    private WmStaticService wmStaticService;

    @GetMapping("/newsDimension")
    public ResponseResult getNewsDimension(@RequestParam String beginDate, @RequestParam String endDate){
        return wmStaticService.getNewsDimension(beginDate,endDate);
    }

    @GetMapping("/newsPage")
    public ResponseResult getNewsPage(@RequestParam String beginDate, @RequestParam String endDate,
                                      @RequestParam Integer page, @RequestParam Integer size){
        return wmStaticService.getNewsPage(beginDate,endDate,page,size);
    }

}
